package net.zjitc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.zjitc.pojo.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
    @Select("select * from vueshop_category")
    public List<Category> getCategoryList();
    @Select("select * from vueshop_category where id = #{id}")
    public Category findCategoryById(Integer id);
    @Insert("insert into vueshop_category(name,picture,pid) values(#{name},#{picture},#{pid})")
    public void add(Category category);
    @Delete("delete from vueshop_category where id = #{id}")
    public void delete(Integer id);
    @Update("update vueshop_category set name = #{name},picture = #{picture},pid = #{pid} where id = #{id}")
    public void update(Category category);
}
